﻿@using EquipmentAlarmSystem.Service.Models.Enum
@using EquipmentAlarmSystem.Service.Models

@model NewDeviceId

@{
    ViewData["Title"] = "添加ModbusTcp设备";
}

<partial name="_SystemConfiguration" />

<form id="myForm" action="/DeviceManagement/AddModusTcpDevice" method="post">

    <!-- 文本输入框 -->
    <label for="Id">设备编号:</label>
    <input type="text" id="Id" name="Id" value="@Model.Id" readonly>
    <br>
    <br>
    <label for="Name">设备名称:</label>
    <input type="text" id="Name" name="Name" value="" required>
    <br>
    <br>
    <label for="Describe">设备描述:</label>
    <input type="text" id="Describe" name="Describe" value="" required>
    <input type="text" id="Protocol" name="Protocol" value="ModbusTcp" style="display: none;" required>
    <br>
    <br>
    <label for="FunctionCode">功能块码:</label>
    <select asp-items="Html.GetEnumSelectList<FunctionBlock>()" name="FunctionCode"></select>
    <br>
    <br>
    <label for="Ip">设备地址:</label>
    <input type="text" id="Ip" name="Ip" value="" required>
    <br>
    <br>
    <label for="Port">设备端口:</label>
    <input type="number" id="Port" name="Port" value="" required>
    <br>
    <br>
    <label for="SlaveAddress">设备编号:</label>
    <input type="number" id="SlaveAddress" name="SlaveAddress" value="" required>
    <br>
    <br>
    <label for="StartAddress">开始地址:</label>
    <input type="number" id="StartAddress" name="StartAddress" value="" required>
    <br>
    <br>
    <label for="NumberOfPoints">地址长度:</label>
    <input type="number" id="NumberOfPoints" name="NumberOfPoints" value="" required>
    <br>
    <br>
    <!-- 提交按钮 -->
    <input type="submit" value="提交">
</form>
@if (Model.Content is not null && Model.Content.Length > 1)
{
    <br>
    <hr>
    <h1>@Model.Content</h1>
}
